#coding: utf-8
class RequestAndComplaint::RegistrationRequestState < ActiveRecord::Base
  has_many :registration_request, :class_name => 'RequestAndComplaint::RegistrationRequest', :foreign_key => 'registration_request'
  default_scope where("deleted = 0")

  def erasable
    req_state = RequestAndComplaint::RegistrationRequest.count_request_state_dependencies(id)
    if req_state >0
      return "Imposible borrar. Existen dependencias en registro de solicitud"    
    end
    return nil
  end
end
